﻿using System;
using System.Windows;
using System.Windows.Controls;
using SomethingSpacialClassLib.Web;
using SomethingSpacial.ViewModel;

namespace SomethingSpacial.Views.Admin
{
    public partial class UserGroupSettings : Page
    {

        SomethingSpacialContext domainContext = new SomethingSpacialContext();

        public UserGroupSettings()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(UserGroupList_Loaded);
            
        }

        #region "Page Events"

        void UserGroupList_Loaded(object sender, RoutedEventArgs e)
        {
            ((UserGroupsViewModel)this.DataContext).loadUserGroups();
        }

        private void buttonUpdate_Click(object sender, RoutedEventArgs e)
        {
            editDataForm.CommitEdit();

            if (editDataForm.CurrentItem != null)
            {
                // SponsorModel sm = editDataForm.CurrentItem as SponsorModel;
                ((UserGroupsViewModel)this.DataContext).UpdateUserGroup();
            }
        }



        #endregion





    }
}
